package com.dushuren.project.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dushuren.project.model.dto.TeamUpdateCureExamineRequest;
import com.dushuren.project.model.entity.TeamCureExamine;
import com.dushuren.project.model.vo.TeamCureExamineVo;

import java.util.List;

/**
* @author qieqie
* @description 针对表【team_cure_examine(队伍公开信息审核表)】的数据库操作Service
* @createDate 2022-10-17 17:53:09
*/
public interface TeamCureExamineService extends IService<TeamCureExamine> {


  /***
   * 校验本月 修改 次数
   * @param teamId
   * @param teamName
   * @return
   */
  Boolean checkUpdateDate(Long teamId, String teamName);

  /***
   * 校验 是否存在为审批的 申请
   * @param teamId
   * @param teamName
   * @return
   */
  Boolean checkUpdateApply(Long teamId, String teamName);


  /***
   * 增加 申请 表
   * @param teamId
   * @param type
   * @param description
   * @return
   */
  Long addApply(Long userId ,Long teamId, String type, String description);

  /***
   *  查询指定队伍信息(审核中 | 通过 | 拒绝) 默认查询审核中过
   * @param updateCureExamineRequest
   * @param examineState
   * @return
   */
  Page<TeamCureExamine> listQueryTeam(TeamUpdateCureExamineRequest updateCureExamineRequest, Integer examineState);

  /***
   * 校验teamCureExamine表中这个Id是否存在，teamApplyState 是否为 0 》 是否为审核状态
   * @param id
   * @return
   */
  TeamCureExamine checkApplyState(Long id);

  /***
   * 查询teamId 是否存在 待审核状态的数据
   */
  Long cureApplyTeam(Long teamId);

}
